package com.design.cjm.behavioral.interpreter.example1;

/**
 * @Author: Jie Ming Chen
 * @Date: 2018/9/26
 * @Version 1.0
 */
public abstract class Expression {

    public void interpret(PlayContext context) {

        if (context.getText().length() == 0) {
            return;
        } else {

            String playKey = context.getText().substring(0, 1);
            context.setText(playKey.substring(2));

            excute(null, 11D);
        }
    }

    public abstract void excute(String key, double value);
}
